﻿<common:CustomPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Flashlight.Views.Mvvm"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:prism="using:Microsoft.Practices.Prism.Mvvm"
    xmlns:common="using:Flashlight.Mvvm.Common"
    xmlns:Designtime="using:Flashlight.Mvvm.Designtime"
    xmlns:Converters="using:Flashlight.Mvvm.Converters"
    xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
    x:Class="Flashlight.Mvvm.Views.MainPage"
    mc:Ignorable="d"
    prism:ViewModelLocator.AutoWireViewModel="True"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Page.Resources>
        <Converters:VisibleWhenOnConverter x:Key="VisibleWhenOnConverter"/>
    </Page.Resources>

    <d:Page.DataContext>
        <Designtime:MainPageViewModel/>
    </d:Page.DataContext>

	<Hub Header="Flashlight" Background="Transparent">
        
		<Interactivity:Interaction.Behaviors>
			<Core:EventTriggerBehavior EventName="Tapped">
				<Core:InvokeCommandAction Command="{Binding ToggleLightCommand}"/>
			</Core:EventTriggerBehavior>
		</Interactivity:Interaction.Behaviors>

		<HubSection>
			<DataTemplate>
				<Viewbox Margin="0,0,20,0" IsHitTestVisible="False">
					<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="Layer_1_2" Width="500" Height="500" Canvas.Left="0" Canvas.Top="0">
						<Viewbox Width="250" Height="95" Canvas.Left="55" Canvas.Top="230">
							<Canvas Width="250" Height="95">
								<Ellipse Width="30" Height="95" Canvas.Left="0" Canvas.Top="0" Stretch="Fill" Fill="#FFFF0000"/>
								<Rectangle Width="235" Height="95" Canvas.Left="15" Canvas.Top="3.05176e-005" Stretch="Fill" Fill="#FFFF0000"/>
							</Canvas>
						</Viewbox>
						<Ellipse Width="30" Height="95" Canvas.Left="290" Canvas.Top="230" Stretch="Fill" Fill="#FF006432"/>
						<Path Width="45" Height="185" Canvas.Left="305" Canvas.Top="185" Stretch="Fill" Fill="#FF006432" Data="F1 M 305,230L 350,185L 350,370L 305,325L 305,230 Z "/>
						<Ellipse Width="30" Height="185" Canvas.Left="335" Canvas.Top="185" Stretch="Fill" Fill="#FF0096FF"/>
						<Path Visibility="{Binding Light.State, Converter={StaticResource VisibleWhenOnConverter}}" Width="125" Height="400" Canvas.Left="360" Canvas.Top="80" Stretch="Fill" Fill="#FFFFFF00" Data="F1 M 360,175L 465,80L 485,480L 360,375L 410,345L 375,315L 430,280L 375,265L 430,235L 370,215L 410,170L 360,175 Z "/>
					</Canvas>
                </Viewbox>
            </DataTemplate>
		</HubSection>
	</Hub>
</common:CustomPage>
